package com.mostsnails.common.base.constant;

/**
 * 检测类型 Type
 *
 * @Author MostSnails
 * @Version 1.0
 */
public enum CheckType {
    /**
     * 手机号验证枚举
     */
    MOBILE("Mobile", "手机", "^1[0-9]{10}$"),
    /**
     * 日期验证枚举
     */
    SHOT_DATE("Date", "短日期格式", "yyyyMMdd"),
    TOOLOOG_DATE("Date", "短日期格式", "yyyyMMddHHmmssSSS"),
    DATE("Date", "常用时间格式", "yyyy-MM-dd HH:mm:ss"),

    /**
     * 字符串表情检测是否包含
     */
    EMOJI("Emoji", "字符串表情检测", "");

    public String value;
    public String label;
    public String regular;

    private CheckType(String value, String label, String regular) {
        this.value = value;
        this.label = label;
        this.regular = regular;
    }

    public static CheckType with(String value) {
        for (CheckType type : CheckType.values()) {
            if (type.value.equalsIgnoreCase(value)) {
                return type;
            }
        }
        return null;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getRegular() {
        return regular;
    }

    public void setRegular(String regular) {
        this.regular = regular;
    }
}
